.font modifier defines Font Family & size.
Syntax
.font(.largeTitle)
.font(.system(size: 200))
.font(Font.system(size: 72))
.font(Font.custom("Arial Rounded MT Bold", size: 18))
.font(Font.custom("Arial Rounded MT Bold", size: 18).weight(.black))
Example
struct ContentView: View {
var body: some View {
VStack {
Text("caption" ).font(.caption)
Text("footnote" ).font(.footnote)
Text("body" ).font(.body)
Text("title" ).font(.title)
Text("largeTitle" ).font(.largeTitle)
Text("subheadline").font(.subheadline)
Text("headline" ).font(.headline)
}
}
}
Output